package com.solution.pc.order.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.solution.common.dao.BaseDao;
import com.solution.common.page.PageBean;
import com.solution.common.page.PageParam;
import com.solution.common.service.impl.BaseServiceImpl;
import com.solution.pc.order.dao.OrderWxpayNotifyLogDao;
import com.solution.pc.order.entity.OrderWxpayNotifyLogEntity;
import com.solution.pc.order.service.OrderWxpayNotifyLogService;

/**
 * 订单微信支付日志service实现层
 * @author xkl
 * @date 2017-11-24 16:46:40
 */
@Service
public class OrderWxpayNotifyLogServiceImpl extends BaseServiceImpl<OrderWxpayNotifyLogEntity> implements OrderWxpayNotifyLogService {

	/**
	 * 订单微信支付日志接口
	 */
	@Autowired
	private OrderWxpayNotifyLogDao orderWxpayNotifyLogDao;

	protected BaseDao<OrderWxpayNotifyLogEntity> getDao() {
		return this.orderWxpayNotifyLogDao;
	}

	/**
	 * 保存订单微信支付日志
	 * @param orderWxpayNotifyLogEntity 订单微信支付日志实体
	 * @return Long 添加成功订单微信支付日志的ID
	 * @author xkl
	 * @date 2017-11-24 16:46:40
	 */
	public long saveOrderWxpayNotifyLog(OrderWxpayNotifyLogEntity orderWxpayNotifyLogEntity) {
		return orderWxpayNotifyLogDao.saveOrderWxpayNotifyLog(orderWxpayNotifyLogEntity);
	}

	/**
	 * 分页查询订单微信支付日志
	 * @param pageParam 分页参数
	 * @param paramMap 查询参数
	 * @return PageBean 分页参数和分页数据
	 * @author xkl
	 * @date 2017-11-24 16:46:40
	 */
	@Override
	public PageBean listOrderWxpayNotifyLogPage(PageParam pageParam, Map<String, Object> paramMap) {
		return orderWxpayNotifyLogDao.listOrderWxpayNotifyLogPage(pageParam, paramMap);
	}
	
	/**
	 * 根据ID查询用户信息
	 * @param id 用户id
	 * @return orderWxpayNotifyLogEntity 用户对象
	 * @author xkl
	 * @date 2017-11-24 16:46:40
	 */
	public OrderWxpayNotifyLogEntity getOrderWxpayNotifyLogById(Long id) {
		return orderWxpayNotifyLogDao.getById(id.longValue());
	}

	/**
	 * 更新用户
	 * @param orderWxpayNotifyLogEntity 用户实体
	 * @return Long 更新是否成功，>1代表更新成功
	 * @author xkl
	 * @date 2017-11-24 16:46:40
	 */
	@Override
	public int updateOrderWxpayNotifyLog(OrderWxpayNotifyLogEntity orderWxpayNotifyLogEntity) {
		return orderWxpayNotifyLogDao.updateOrderWxpayNotifyLog(orderWxpayNotifyLogEntity);
	}
	
	
	/**
	 * 根据条件查询订单微信支付日志
	 * @param param
	 * @return 数据列表
	 * @author xkl
	 * @date 2017-11-24 16:46:40
	 */
	@Override
	public List<OrderWxpayNotifyLogEntity> listOrderWxpayNotifyLog( Map<String, Object> param){
		return  orderWxpayNotifyLogDao.listOrderWxpayNotifyLog(param);
	}
	
	/**
	 * 删除订单微信支付日志
	 * @param 
	 * @return int 返回删除记录条数
	 * @author xkl
	 * @date 2017-11-24 16:46:40
	 */
	public int deleteOrderWxpayNotifyLogById(long id){
		return  orderWxpayNotifyLogDao.deleteById(id);
	}
	
}
